#ifndef WIDGET_H_
#define WIDGET_H_

#include <stdio.h>
#include <list>
#include <iostream>

#include "SDL/SDL.h"
#include "SDL/SDL_image.h"

#include "Parcel.h"
#include "Event.h"

class Widget {

protected:

	Parcel parcel;

	Widget* parent;

	Widget();


	//Upper left corner
	Parcel getPosition();

	SDL_Surface* loadSurface(std::string path);

public:

	Widget(int posX, int posY, Widget* parent = NULL);

	virtual void handleEvent (Event event) = 0;

	virtual void resolve() = 0;

	virtual void showOn(SDL_Surface* surface) = 0;

	bool mouseOver(Event event) const;

	virtual ~Widget();
};

#endif /* WIDGET_H_ */
